<template>
    <div>
        <page-main>
            <router-link :to="{name: 'breadcrumbExampleDetail1'}">查看详情页</router-link>
            <el-tag>{{ account }},{{ token }}</el-tag>
            <download-excel
            class="export-excel-wrapper"
            :data="DetailsForm"
            :fields="json_fields"
            :header="title"
            name="需要导出的表格名字.xls"
        >
        <!-- 上面可以自定义自己的样式，还可以引用其他组件button -->
            <el-button type="success">导出</el-button>
        </download-excel>
        </page-main>
    </div>
</template>
<script>
export default {
    data() {
        return {
            account: this.$store.state.user.account,
            token: this.$store.state.user.token,
            title: "xx公司表格",
            json_fields: {
                "排查日期": 'date',
                "整改隐患内容": 'details',
                "整改措施": 'measure',
                "整改时限": 'timeLimit',
                "应急措施和预案": 'plan',
                "整改责任人": 'personInCharge',
                "填表人": 'preparer',
                "整改资金": 'fund',
                "整改完成情况": 'complete',
                "备注": 'remark'
            },
            DetailsForm: [
                {
                    date: "2022-3-10",
                    details: "卸油区过路灯损坏",
                    measure: "更换灯泡",
                    timeLimit: "2022-3-21",
                    plan: "先使用充电灯代替,贴好安全提醒告示",
                    personInCharge: "王xx",
                    preparer: "王xx",
                    fund: "20元",
                    complete: "已完成整改",
                    remark: "重新更换了灯泡"
                },
                {
                    date: "2022-3-10",
                    details: "卸油区过路灯损坏",
                    measure: "更换灯泡",
                    timeLimit: "2022-3-21",
                    plan: "先使用充电灯代替,贴好安全提醒告示",
                    personInCharge: "王xx",
                    preparer: "王xx",
                    fund: "20元",
                    complete: "已完成整改",
                    remark: "重新更换了灯泡"
                },
                {
                    date: "2022-3-10",
                    details: "卸油区过路灯损坏",
                    measure: "更换灯泡",
                    timeLimit: "2022-3-21",
                    plan: "先使用充电灯代替,贴好安全提醒告示",
                    personInCharge: "王xx",
                    preparer: "王xx",
                    fund: "20元",
                    complete: "已完成整改",
                    remark: "重新更换了灯泡"
                }
            ]
        }
    }
}
</script>